import * as React from "react";
import * as ReactDOM from "react-dom";
import {HashRouter, Route, hashHistory, Switch} from 'react-router-dom'

import UserCenter from "./UserCenter/UserCenter";
import Login from "./Login/Login";
import NotFound from "./Components/NotFound/NotFound";
import AgentList from "./AgentList/AgentList";
import ShareAgentList from "./ShareAgentList/ShareAgentList";
import AgentReview from "./AgentReview/AgentReview";
import Shipments from "./Shipments/Shipments";
import ShipmentsLogs from "./ShipmentsLogs/ShipmentsLogs";
import CustomerGetAgentLevel from "./CustomerGetAgentLevel/CustomerGetAgentLevel";
import Certificate from "./Certificate/Certificate";
import ShareUrlViewList from "./ShareUrlViewList/ShareUrlViewList";
import CustomerGetCustomerList from "./CustomerGetCustomerList/CustomerGetCustomerList";
import CheckNextAgent from "./CheckNextAgent/CheckNextAgent";
import OrderGoodsList from "./OrderGoodsList/OrderGoodsList";
import OrderGoodsDetail from "./OrderGoodsDetail/OrderGoodsDetail";
import Cart from "./Cart/Cart";

const SliderComponent = () => (
    <Switch>
        <Route exact path='/' component={UserCenter}/>
        <Route path="/user" component={UserCenter}/>
        <Route path="/login" component={Login}/>
        <Route path="/agent-list" component={AgentList}/>
        <Route path="/share-agent-list" component={ShareAgentList}/>
        <Route path="/agent-review" component={AgentReview}/>
        <Route path="/shipments" component={Shipments}/>
        <Route path="/shipments-logs" component={ShipmentsLogs}/>
        <Route path="/customer-get-agent-level" component={CustomerGetAgentLevel}/>
        <Route path="/certificate" component={Certificate}/>
        <Route path="/share-url-view-list" component={ShareUrlViewList}/>
        <Route path="/customer-get-customer-list" component={CustomerGetCustomerList}/>
        <Route path="/check-next-agent" component={CheckNextAgent}/>
        <Route path="/order-goods-list" component={OrderGoodsList}/>
        <Route path="/order-goods-detail" component={OrderGoodsDetail}/>
        <Route path="/cart" component={Cart}/>
        {/*<Route path="/alter-password" component={AlterPassword}/>*/}
        {/*<Route path="/shop" component={Shop}/>*/}
        {/*<Route path="/cart/:addressID" component={Cart}/>*/}
        {/*<Route path="/cart" component={Cart}/>*/}
        {/*<Route path="/address" component={Address}/>*/}
        {/*<Route path="/order" component={Order}/>*/}
        {/*<Route path="/tips" component={ResultTips}/>*/}
        {/*/!*<Route path="/order-detail/:ID" component={OrderAllInfo}/>*!/*/}
        {/*<Route path="/subordinate" component={Subordinate}/>*/}
        {/*<Route path="/subordinate-list" component={SubordinateList}/>*/}
        {/*<Route path="/subordinate-level/:userID" component={SubordinateLevel}/>*/}
        <Route path="*" component={NotFound}/>
    </Switch>
)


ReactDOM.render((
    <HashRouter history={hashHistory}>
        <SliderComponent/>
    </HashRouter>
), document.getElementById('page'));